package com.qianyu.project.mapper.provider;

import org.apache.ibatis.jdbc.SQL;
import org.springframework.util.ObjectUtils;

import java.awt.*;
import java.util.Map;

/**
 * @Author ww
 * @desc
 */
public class OutputProgressPlanProvider {

    public String List(Map<String,String> params){
        return new SQL(){
            {
                SELECT("*");
                FROM("output_progress_plan p ,project_info pi");
                WHERE("p.p_id=pi.id");
                if(!ObjectUtils.isEmpty(params.get("plan_subject"))){
                  WHERE("plan_subject like '%"+params.get("plan_subject")+"%'");
                }
                if(!ObjectUtils.isEmpty(params.get("plan_date"))){
                    WHERE("plan_date >= '"+params.get("plan_date")+"' ");
                }
                if(!ObjectUtils.isEmpty(params.get("editer_id"))){
                    WHERE("editer_id like '%"+params.get("editer_id")+"%'");
                }
            }
        }.toString();
    }
}
